# -*- coding:utf-8 -*-
from com.mat.rpa.utils.globalConstants import GlobalConstants
from com.mat.rpa.views.workWindow.leftPanel.directiveTree import treeItem
from . import desktopAutoConstants
from .desktopElementOperation import desktopElementSubDirectiveTree
from .desktopWindowOperation import desktopWindowSubDirectiveTree
from .desktopDataExtraction import desktopDataExtractionSubDirectiveTree
from .SAPOperation import SAPOperationSubDirectiveTree
class DesktopAutoSubDirectiveTree(treeItem.TreeItemWithID):
    def __init__(self, parent):
        super(DesktopAutoSubDirectiveTree, self).__init__(parent)
        self.createDesktopAutoSubTreeNode()

    def createDesktopAutoSubTreeNode(self):
        self.nodeType = GlobalConstants.treeBranchType
        self.directiveType = "desktopAuto"
        self.setText(0, "桌面软件自动化")
        self.createTreeNode(GlobalConstants.treeLeafType,
                            self, desktopAutoConstants.DesktopAutoConstants.gettingWinObjectDirective, "获取窗口对象(Win)")
        self.createTreeNode(GlobalConstants.treeLeafType,
                            self, desktopAutoConstants.DesktopAutoConstants.clickingWinElementDirective, "点击元素(Win)")
        self.createTreeNode(GlobalConstants.treeLeafType,
                            self, desktopAutoConstants.DesktopAutoConstants.mouseHoveringOverWinElementDirective, "鼠标悬停在元素上(Win)")
        self.createTreeNode(GlobalConstants.treeLeafType,
                            self, desktopAutoConstants.DesktopAutoConstants.fillingInWinInputDirective, "填写输入框(Win)")
        self.createTreeNode(GlobalConstants.treeLeafType,
                            self, desktopAutoConstants.DesktopAutoConstants.runAndOpenWinDirective, "运行或打开软件(Win)")
        #挂载子树
        desktopElementSubDirectiveTree.DesktopElementSubDirectiveTree(self) #挂载桌面元素操作子节点
        desktopWindowSubDirectiveTree.DesktopWindowSubDirectiveTree(self) #挂载桌面软件窗口操作子节点
        desktopDataExtractionSubDirectiveTree.DesktopDataExtractionSubDirectiveTree(self) #挂载数据抽取子节点
        SAPOperationSubDirectiveTree.SAPOperationSubDirectiveTree(self) #挂载SAP操作子节点
